<template>
    <g-layout :back="false" title="传承" class="waterfall_vue">

        <view class="pd-10">
            <u-subsection :list="list" :current="current" mode="subsection" @change="subsectionChange" />
        </view>

        <scroll-view class="g-flex-body" :scroll-y="true" :scroll-x="true">
            <ly-tree ref="tree"
                     :props="defaultProps"
                     :tree-data="treeData"
                     iconClass="arrow-down-fill"
                     node-key="name"
                     expand-on-check-node />
        </scroll-view>
    </g-layout>
</template>

<script>
import childData from "./child.json"

export default {
    data() {
        return {
            defaultProps: () => {
                return {
                    label: 'name',
                    children: 'children',
                    icon: 'icon'
                }
            },
            treeData:[],
            current: 0,
            list:[{name:'头坪'},{name:'山嘎'},{name:'武称'},{name:'老房子'},{name:'上林'},{name:'什岩'},{name:'大坪'}],
        }
    },
    mounted() {
        const self = this;
        self.treeData = childData.data
    },
    onBackPress(options) {
        if (options.from === 'navigateBack') {
            return false;
        }
        return true;
    },
    methods:{
        subsectionChange(e){
            this.current = e
        },
    }
}
</script>

<style scoped lang="scss">
/deep/.ly-tree-node__expand-icon-holder .u-icon{color: #007aff;}
</style>
